Skip to content

feat: start, stop, status Commands#1

Merged
DylanDevelops merged 8 commits into
mainfrom
ravel/initial-working-prototype
Dec 7, 2025
Merged

feat: start, stop, status Commands#1
DylanDevelops merged 8 commits into
mainfrom
ravel/initial-working-prototype

Conversation

@DylanDevelops
Copy link
Copy Markdown
Owner

This pull request introduces a significant refactor and implementation of core functionality for the tmpo CLI time tracker. The changes replace placeholder code with real time tracking logic, add persistent storage using SQLite, and provide user-friendly command-line interactions for starting, stopping, and checking the status of time tracking sessions.

The most important changes are:

Core functionality and commands:

  • Implemented real logic for the start, stop, and status commands, including user feedback, error handling, and automatic project detection based on the current directory. The commands now interact with persistent storage and provide clear output to the user. [1] [2] [3]

Persistent storage:

  • Added a new internal/storage package with a Database wrapper for SQLite, including initialization, schema migration, and CRUD operations for time entries. This enables tracking sessions to persist across runs.
  • Defined a TimeEntry model with helper methods for duration calculation and running status.

User experience improvements:

  • Updated command descriptions and help text to accurately reflect the application's purpose and usage, making the CLI more user-friendly and professional.
  • Added version information to the CLI root command.

Dependency and project setup:

  • Updated go.mod to include only the required dependencies for SQLite and Cobra, cleaning up unused indirect dependencies.
  • Removed unnecessary license and placeholder comments from main.go.

Introduces a Database struct for managing time entries using SQLite, including initialization, entry creation, retrieval, stopping, and closing. Adds a TimeEntry model with duration and running status helpers to support time tracking functionality.
Adds a functional 'start' command to begin time tracking for the current project, including checks for existing running sessions and project name detection. Enhances internal/storage/db.go with detailed documentation for the Database type and its methods, clarifying usage and error handling. Updates CLI descriptions for improved clarity and sets the application version.
Added logic to stop the currently running time tracking session, including error handling and duration formatting. The command now interacts with the storage layer to find and stop active sessions, and prints the tracked duration in a human-readable format.
Added logic to the status command to display information about the currently running time tracking session, including project name, start time, duration, and description. Also made minor formatting adjustments in start and stop commands for consistency.
Deleted the internal/commands/root.go file. This may be part of a refactor or cleanup to remove unused or obsolete command logic.
Imported the github.com/mattn/go-sqlite3 package to enable SQLite database support in the storage layer.
Bump CLI version to 0.1.0. Remove unused dependencies from go.mod and go.sum. Improve error message consistency in internal/storage/db.go by using lowercase. Remove license comment from main.go.
@DylanDevelops DylanDevelops merged commit 227ffbf into main Dec 7, 2025
@DylanDevelops DylanDevelops deleted the ravel/initial-working-prototype branch December 7, 2025 18:21
@DylanDevelops DylanDevelops changed the title [add] start, stop, status Commands feat: start, stop, status Commands Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant